home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / sharew / accs / drupatch / rich_lib / file.c next >
Encoding:
C/C++ Source or Header  |  1985-07-21  |  704 b   |  46 lines

  1. #include <define.h>
  2. /*
  3.  *        Pfad mit Dateinamen versehen
  4. */
  5.  
  6. char*  path_cat (path, file)
  7. register char  *path;
  8. char  *file;
  9. {
  10.     register char  *i = NIL;
  11.  
  12.     while (*path)
  13.         if (*path++ == '\\')
  14.             i = path;
  15.     if (i)
  16.         path = i;
  17.     else
  18.         *path++ = '\\';
  19.     strcpy (path, file);
  20.     return (path);
  21. }
  22.  
  23.  
  24. /*
  25.  *        Eine Datei auswaehlen
  26. */
  27.  
  28. char*  file_select (path, selection)
  29. char    *path;
  30. char    *selection;
  31. {
  32.     int  button;
  33.     char file[14];
  34.  
  35.     if (!path[0]) {
  36.         path[0] = Dgetdrv() + 'A';
  37.         path[1] = ':';
  38.         Dgetpath (path + 2, 0);
  39.     }
  40.     path_cat (path, selection);
  41.     file[0] = '\0';
  42.     fsel_input (path, file, &button);
  43.     if (!button)
  44.         return (NIL);
  45.     return (path_cat (path, file));
  46. }